package linkQuestion

// 反转双向链表

type DoubleListNode struct {
	Next *DoubleListNode
	Pre  *DoubleListNode
	Val  int
}

func ReverseDoubleList(head *DoubleListNode) *DoubleListNode {
	var pre, next *DoubleListNode
	for head != nil {
		next = head.Next
		head.Next = pre
		head.Pre = next
		pre = head
		head = next
	}

	return pre
}
